﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace kTudu.Web.Helpers
{
    public static class CookieHelper
    {
        public static string CookieName
        {
            get
            {
                return "kTuduCookie";
            }
        }
        public static void SetCookie(string userName, int cookieExpireDate = 30)
        {
            HttpCookie myCookie = new HttpCookie(CookieName);
            myCookie["userName"] = userName.ToString();
            myCookie.Expires = DateTime.Now.AddDays(cookieExpireDate);
            HttpContext.Current.Response.Cookies.Add(myCookie);
        }
    }
}